//
//  BLSecurDetailController.m
//  Byelone
//
//  Created by Qi Liu on 2021/2/11.
//

#import "BLSecurDetailController.h"
#import <WebKit/WKWebView.h>

@interface BLSecurDetailController ()

@property(nonatomic,strong) WKWebView * webView;
@property(nonatomic,strong)UIImageView * baseImageView;

@property(nonatomic,copy)NSString * priUrlString;

@end


@implementation BLSecurDetailController
-(instancetype)initWithType:(ViewType )type{
    if (self = [super init]) {
        self.type = type;
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.priUrlString = @"https://www.baidu.com";
    
    if (_type == ViewType_Protocol) {
        WKWebView * view = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, BL_WINDOW_WIDTH, BL_WINDOW_WIDTH-BL_NAVANDSTATUS_HEIGHT)];
        [self.view addSubview:view];
        [view loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.priUrlString]]];
    }else{
        _baseImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, BL_WINDOW_WIDTH, BL_WINDOW_HEIGHT - BL_NAVANDSTATUS_HEIGHT)];
        _baseImageView.contentMode = UIViewContentModeScaleAspectFit;
        if (_type == ViewType_Hight) {
            _baseImageView.image = [UIImage imageNamed:@"my_hight"];
        }else{
            _baseImageView.image = [UIImage imageNamed:@"my_award"];
        }
        [self.view addSubview:_baseImageView];
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
